import 'dart:io';
import 'package:image_pickers/image_pickers.dart';
/*
  选择后的图片实体
 */
class ImagePickerEntity {
  // 图片file
  File? _file;

  //图片本地地址
  String? _filePath;

  //网络地址
  String? _netWorkPath;

  //图片 Media;
  Media? _fileMedia;

  ImagePickerEntity({File? file,String? filePath,String? netWorkPath,Media? fileMedia}){
    this._file = file;
    this._filePath = filePath;
    this._netWorkPath = netWorkPath;
    this._fileMedia = fileMedia;
  }

  File? get file => _file;
  set setFile(File file) => _file = file;
  String? get filePath => _filePath;
  set setFilePath(String filePath) => _filePath = filePath;
  String? get netWorkPath => _netWorkPath;
  set setNetWorkPath(String netWorkPath) => _netWorkPath = netWorkPath;
  Media? get fileMedia => _fileMedia;
  set setFileMedia(Media fileMedia) => _fileMedia = fileMedia;

  ImagePickerEntity.fromJson(Map<String,dynamic> json){
    _file = json['file'];
    _filePath = json['filePath'];
    _netWorkPath = json['netWorkPath'];
    _fileMedia = json['fileMedia'];

  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['file'] = this._file;
    data['filePath'] = this._filePath;
    data['netWorkPath'] = this._netWorkPath;
    data['fileMedia'] = this._fileMedia;

    return data;
  }
}